home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / libg_261.zip / libg_261 / libio / tests / tiomanip.cc < prev    next >
C/C++ Source or Header  |  1993-08-20  |  596b  |  36 lines

  1. // test the parametrized manipulators
  2.  
  3. #include <stdlib.h>
  4. #include <iomanip.h>
  5.  
  6. main()
  7. {
  8. #ifdef _G_NO_TEMPLATES
  9.     cerr << "(IO manipulators are not supported with this compiler)\n");
  10.     exit(-1);
  11. #else
  12.  
  13.     cout << dec  << 1234 << ' '
  14.          << hex  << 1234 << ' '
  15.      << oct  << 1234 << endl;
  16.  
  17.     //SMANIP<int> x = setw(4);
  18.     //operator<<(cout, x);
  19.  
  20.     cout
  21.       << "("
  22.       << dec << setw(4) << setfill('*') 
  23.       << 12 << ")\n";
  24.     
  25.     cout << "(" << 12 << ")\n";
  26.  
  27.     cout << setiosflags(ios::internal);
  28.     cout << "(" << setw(6) << -12 << ")\n";
  29.  
  30.     exit(0);
  31. #endif
  32. }
  33.  
  34.  
  35.                     
  36.